<?php
class Rsa{
    public static function privateSign($data, $private_key, $type=OPENSSL_ALGO_SHA256){
        openssl_sign($data, $signature, $private_key, $type);
        return base64_encode($signature);
    }

    public static function publicDecrypt($data, $public_key){
        openssl_public_decrypt($data, $decrypted, $public_key);
        return $decrypted;
    }
}